/**
 * 
 */
package com.yerba.ricecooker.utility;

import java.text.DecimalFormat;
import java.util.UUID;

/**
 * @author mxie
 * 
 */
public class CommonHelper
{
    public static String NEWLINE = System.getProperty("line.separator");

    public static void disableApacheLogging()
    {
        System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
    }

    public static String getTempFileName()
    {
        return System.getProperty("java.io.tmpdir") + "/slowrc-" + UUID.randomUUID().toString() + ".html";
    }
    
    public static String formatDouble(double value)
    {
        DecimalFormat df = new DecimalFormat("#.###");
        return df.format(value);
    }

    public static String formatDouble(Double value)
    {
        return formatDouble(value.doubleValue());
    }

}
